package com.beetlestech.nfe.main.biz.com.impl;

import java.util.List;

import com.beetlestech.nfe.fw.core.biz.AbstractDBLogic;
import com.beetlestech.nfe.fw.core.type.AutoInject;
import com.beetlestech.nfe.fw.core.util.CollectionUtil;
import com.beetlestech.nfe.main.biz.com.HbExaminationMaster;
import com.beetlestech.nfe.main.biz.com.HbMasterCache;
import com.beetlestech.nfe.main.biz.com.dto.ExaminationGroupInfoDTO;
import com.beetlestech.nfe.main.biz.constant.HbMessageCode;
import com.beetlestech.nfe.main.biz.constant.MasterCacheConstant.MASTER_NAME;

public class HbExaminationMasterImpl  extends AbstractDBLogic implements HbExaminationMaster, HbMessageCode {
	/**
	 * EXAMINATION：车辆检查项目 字典
	 */
	private static final String MSG_PARAM_TCOMBLCM = "EXAMINATION：车辆检查项目 字典";

	/**
	 * マスターキャッシュ Bizロジック
	 */
	@AutoInject
	protected HbMasterCache hbMasterCache;

	/* (non-Javadoc)
	 * @see com.beetlestech.nfe.main.biz.com.HbComblcmMaster#getComblcmInfo(java.lang.String, java.lang.String, java.lang.String)
	 */
	@Override
	public ExaminationGroupInfoDTO getComblcmInfo
			(String ExaminationGroupNo) {

		//ビジネスロジック設定マスター情報を検索する
		List<ExaminationGroupInfoDTO> examinationInfoDTOs = hbMasterCache.getMasterData(MASTER_NAME.EXAMINATION, ExaminationGroupNo);

		if (CollectionUtil.isEmpty(examinationInfoDTOs)) {
			//1件も取得できなかった場合は、「ApplicationException」を返す
			createApplicationException(M10440WS, MSG_PARAM_TCOMBLCM);
		}

		//ビジネスロジック設定マスター情報を返す
		return examinationInfoDTOs.get(0);
	}
}
